﻿@model NB.MGJ.Model.CodeManage_Apply

@{
    Layout = null;
}


<form id="form_ApplyCodeAdd" role="form" class="form-horizontal" onkeydown="if(event.keyCode==13){return false;}">
    <div class="form-group">
        <div class="col-xs-2 col-md-2 text-right">
            <span class="red-700">*</span>
            申请机构:
        </div>
        <div class="col-xs-4 col-md-4">
            @Html.DropDownList("EnterpriseId", null, new { @class = "form-control" })
        </div>

        <div class="col-xs-2 col-md-2  text-right">
            <span class="red-700">*</span>
            申请人:
        </div>
        <div class="col-xs-4 col-md-4">
            <input type="text" id="ApplyUserName" name="ApplyUserName" value="@ViewBag.Ename" class="form-control" readonly="readonly" />
        </div>
    </div>
    @*<div class="form-group">
        <div class="col-xs-2 col-md-2 text-right">
            应用品牌:
        </div>
        <div class="col-xs-4 col-md-4">
            <input type="text" name="ApplyBrand" class="form-control" placeholder="请输入应用品牌" />
        </div>*@
    <div class="form-group">
        <div class="col-xs-2 col-md-2 text-right">
            <span class="red-700">*</span>申请码类型:
        </div>
        <div class="col-xs-4 col-md-4 text-left">
            <label for="CodeTypes">
                <input id="CodeTypes" type="checkbox" name="ApplyCodeTypes" value="1" />&nbsp;服务码
            </label>
            <label for="CodeTypes_2">
                <input id="CodeTypes_2" type="checkbox" name="ApplyCodeTypes" value="2" style="margin-left:20px;" />&nbsp;管理码
            </label>
            <input type="hidden" name="CodeFunc" id="CodeFunc" />
        </div>


        <div class="col-xs-2 col-md-2  text-right">
            @*<span class="red-700">*</span>*@
            应用产品:
        </div>
        <div class="col-xs-4 col-md-4">
            @Html.DropDownList("ProductId", null, new { @class = "form-control" })
        </div>
    </div>
    <div class="form-group">
        <div class="col-xs-2 col-md-2 text-right">
            产品规格:
        </div>
        <div class="col-xs-4 col-md-4">
            <input type="text" id="ApplyProductSize" name="ApplyProductSize" class="form-control" placeholder="请输入产品规格" />
        </div>

        <div class="col-xs-2 col-md-2  text-right">
            <span class="red-700">*</span>
            申请数量
            <br />
            （单标）:
        </div>
        <div class="col-xs-4 col-md-4">
            <input id="ApplyCount" name="ApplyCount" value="" class="form-control" placeholder="请输入申请数量" />
        </div>
    </div>
    <div class="form-group">
        <div class="col-xs-2 col-md-2 text-right">

            备注:
        </div>
        <div class="col-xs-10 col-md-10">
            <textarea class="form-control" id="ApplyReason" name="ApplyReason" placeholder="可填写管理码的拖标关系"></textarea>
        </div>
    </div>
</form>
<script>
    $(function () {
        $('#form_ApplyCodeAdd').bootstrapValidator({
            group: '.col-xs-4.col-md-4',
            fields: {
                EnterpriseId:{
                    validators: {
                        notEmpty: {
                            message: '申请机构不能为空'
                        }
                    }
                },
                //ApplyUserName: {
                //    validators: {
                //        notEmpty: {
                //            message: '申请人不能为空！'
                //        },
                //        regexp: {
                //            regexp: /^[a-zA-Z0-9\u4e00-\u9fa5]+$/,
                //            message: '申请人不能输入符号'
                //        },
                //        stringLength: {
                //            max: 10,
                //            message: '申请人最大长度为10'
                //        }
                //    }
                //},
               
                ApplyCount: {
                    validators: {
                        notEmpty: {
                            message: '申请数量不能为空'
                        },
                        regexp: {
                            regexp: /^[1-9]*[1-9][0-9]*$/,
                            message: '申请数量为正整数'
                        }
                    }
                },
                ApplyCodeTypes: {
                    validators: {
                        notEmpty: {
                            message: '码类型不能为空'
                        },
                    }
                },
                ApplyBrand: {
                    regexp: {
                        regexp: /^[a-zA-Z0-9\u4e00-\u9fa5]+$/,
                        message: '应用品牌不能输入符号'
                    }
                },
                ApplyProductSize: {
                    regexp: {
                        regexp: /^[a-zA-Z0-9\u4e00-\u9fa5]+$/,
                        message: '产品规格不能输入符号'
                    }
                }
            }
        })
    });
</script>